package Code;

import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class QuestionNum_22_5_hxj {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要遍历的文件夹路径：");
        String s = sc.nextLine();
        File file = new File(s);
        countFile(file);
    }
    private static void countFile(File file ) {
        Map<String,String> map = new HashMap<>();
        int count = 0;
        File[] files = file.listFiles();

        for (File f : files) {
            if (f.isFile()){
//                System.out.println(f);
                String s = f.toString();
                String[] split = s.split(".");
                System.out.println(split[0]);
            }else{
                countFile(f);
            }
        }
    }
}
